home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / mkutil21.zip / MAKEDEFS / COMMON.MK < prev    next >
Text File  |  1995-02-06  |  4KB  |  116 lines

  1. #############################################################################
  2. #
  3. #                       Copyright (C) 1994 SciTech Software
  4. #                               All rights reserved.
  5. #
  6. # Descripton:   Common makefile targets used by all SciTech Software
  7. #               makefiles. This file includes targets for cleaning the
  8. #               current directory, and maintaining the source files with
  9. #               RCS.
  10. #
  11. # $Id: common.mk 1.1 1995/02/06 12:49:39 kjb release $
  12. #
  13. #############################################################################
  14.  
  15. # Target to build the library file if specified
  16.  
  17. .IF $(LIBFILE)
  18.  
  19. lib: $(LIBFILE)
  20.  
  21. $(LIBFILE): $(OBJECTS)
  22.  
  23. # Install the library files
  24.  
  25. install: $(LIBFILE)
  26.     $(INSTALL) $(LIBFILE) $(LIB_DEST)$(LIB_EXTENDER)
  27.  
  28. .END
  29.  
  30. # Define where the local include files are kept for dependencies in
  31. # makefiles after this file is included.
  32.  
  33. INC :=  $(SCITECH)\INCLUDE
  34.  
  35. # Clean up directory removing all files not needed to make the library.
  36. # There seems to be a bug in the version of RM that we are using, that
  37. # causes it to not delete all the files if there are lots of them, hence
  38. # we issue the rm command twice which should solve the problem (until we
  39. # get a fixed version of RM).
  40.  
  41. clean:
  42.     -rm -f *.obj *.o *.sym *.bak *.tdk *.swp *.map *.err *.csm *.pch *.pdb
  43.     -rm -f *.obj *.o *.sym *.bak *.tdk *.swp *.map *.err *.csm *.pch *.pdb
  44.     -rm -f *.dsw *.rws *.res
  45. .IF $(LIBFILE)
  46.     -rm -f $(LIBFILE) $(LIBCLEAN)
  47. .END
  48.  
  49. cleanexe:   clean
  50. .IF $(UNIX)
  51.     -rm -f $(EXEFILES)
  52. .ELSE
  53.     -rm -f *$E *.drv
  54. .ENDIF
  55.  
  56. realclean:  cleanexe
  57. .IF $(LIBFILE)
  58.     -rm -f $(LIB_DEST)\$(LIBFILE)
  59. .END
  60.  
  61. .IF $(LOCALRCS) == $(NULL)
  62.  
  63. # RCS Maintenance routines. Assumes the existence of the RCSFILES list
  64. # to determine the files to apply the RCS commands to, and that the
  65. # foreach.exe program is available on the path. For all files in the
  66. # RCSFILES_H list we either copy the files from the standard include
  67. # directory in order to check them in, or copy the checked out files back
  68. # into the standard include directory (the -cf and -ct options of foreach).
  69.  
  70. stamp:
  71.     @foreach "rcs -N$(VERSION): -srelease" $(mktmp $(RCSFILES:t" \n")\n)
  72.     @foreach "rcs -N$(VERSION): -srelease" $(mktmp $(RCSFILES_H:t" \n")\n)
  73.  
  74. rcsit:
  75.     @foreach "rcs $(RCSOPT)" $(mktmp $(RCSFILES:t" \n")\n)
  76.     @foreach "rcs $(RCSOPT)" $(mktmp $(RCSFILES_H:t" \n")\n)
  77.  
  78. # Remove unchanged source files (public header files are not removed)
  79.  
  80. rcsclean:
  81.     @foreach rcsclean $(mktmp $(RCSFILES:t" \n")\n)
  82.     @foreach -cl $(INC) rcsclean $(mktmp $(RCSFILES_H:t" \n")\n)
  83.  
  84. # Check in the latest revisions of source files with RCS
  85.  
  86. ci:
  87.     @foreach "ci -q -u -mnone $(RCSOPT)" $(mktmp $(RCSFILES:t" \n")\n)
  88.     @foreach -cf $(INC) "ci -q -u -mnone $(RCSOPT)" $(mktmp $(RCSFILES_H:t" \n")\n)
  89.  
  90. # Check out the latest revisions of source files from RCS
  91.  
  92. co:
  93.     @foreach "co -q $(RCSOPT)" $(mktmp $(RCSFILES:t" \n")\n)
  94.     @foreach -ct $(INC) "co -q $(RCSOPT)" $(mktmp $(RCSFILES_H:t" \n")\n)
  95.  
  96. .ENDIF
  97.  
  98. # Create the include file dependencies using the MKUTIL makedep program if
  99. # the list of dependent object files is defined
  100.  
  101. .IF $(DEPEND_OBJ)
  102. depend:
  103.     @rm -f makefile.dep
  104. .IF $(DEPEND_SRC)
  105.     @makedep -amakefile.dep -r -s -S$(DEPEND_SRC:s/\/\\) @$(mktmp $(DEPEND_OBJ:t"\n")\n)
  106. .ELSE
  107.     @makedep -amakefile.dep -r -s @$(mktmp $(DEPEND_OBJ:t"\n")\n)
  108. .ENDIF
  109.     +@echo Object file dependency information generated.
  110. .ENDIF
  111.  
  112. # Include file dependencies
  113.  
  114. .INCLUDE .IGNORE: "makefile.dep"
  115.  
  116.